<?php
/**
 * CONTENIDO extension pack (mpContenidoX), consists of multiple classes to
 * provide more features for Plugins/Modules.
 *
 * @package     mpContenidoX
 * @subpackage  PluginInstaller
 * @author      Murat Purc <murat@purc.de>
 * @copyright   Copyright (c) 2008-2012 Murat Purc (http://www.purc.de)
 * @license     http://www.gnu.org/licenses/gpl-2.0.html - GNU General Public License, version 2
 * @version     $Id: DependencyData.class.php 21 2012-07-16 21:33:14Z purcaholic $
 */


defined('CON_FRAMEWORK') or die('Illegal call');


/**
 * Plugin dependeny data class.
 *
 * @package     mpContenidoX
 * @subpackage  PluginInstaller
 * @author      Murat Purc <murat@purc.de>
 * TODO: Add callback function property getter/setter
 */
class mpPluginInstaller_DependencyData
{
    const TYPE_CONTENIDO = 'contenido';
    const TYPE_PLUGIN    = 'plugin';
    const TYPE_CALLBACK  = 'callback';

    private $_type;
    private $_idinternal;
    private $_version;
    private $_url;

    public function __construct($type)
    {
        if ($type !== self::TYPE_CONTENIDO && $type !== self::TYPE_PLUGIN && $type !== self::TYPE_CALLBACK) {
            throw new mpPluginInstaller_Exception("Invalid type $type");
        }
        $this->_type = $type;
    }

    public function setType($type)
    {
        $this->_type = $type;
    }

    public function getType()
    {
        return $this->_type;
    }

    public function setIdInternal($idInternal)
    {
        $this->_idinternal = $idInternal;
    }

    public function getIdInternal()
    {
        return $this->_idinternal;
    }

    public function setVersion($version)
    {
        $this->_version = $version;
    }

    public function getVersion()
    {
        return $this->_version;
    }

    public function setUrl($url)
    {
        $this->_url = $url;
    }

    public function getUrl()
    {
        return $this->_url;
    }

}

